<!--pcb订单-邮寄 smt弹框 -->
<template>
  <el-dialog :title="$t('om.PCBInfo')" :visible.sync="pcbVisible" width="379px" height="330px">
    <div class="main">
      <ul>
        <li>
          <span>{{ $t('om.Sheets') }}：</span>
          <span>{{ pcbData.productCategoryName }}</span>
        </li>
        <li>
          <span> {{ $t('om.BoardSize') }}：</span>
          <span> {{ pcbData.pcbLength }}CM* {{ pcbData.pcbWidth }}CM</span>
        </li>
        <li>
          <span> {{ $t('om.Platelayer') }}：</span> <span>{{ pcbData.pcbLayer }}</span>
        </li>
        <li>
          <span>{{ $t('om.ofboards') }}：</span> <span>{{ pcbData.orderPcbNumber }}</span>
        </li>
        <li>
          <span> {{ $t('om.GerberDocument') }}： </span>
          <span>{{ pcbData.fileVO?.fileName }}</span>
        </li>
      </ul>
    </div>
    <template #footer>
      <span class="dialog-footer">
        <el-button type="primary" @click="goToMail">{{ $t('om.gotothemail') }}</el-button>
      </span>
    </template>
  </el-dialog>
</template>
<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { queryPcbaPcbOrderList } from '@/server/api/biz.js';
const props = defineProps({
  value: {
    type: Boolean,
    default: false,
  },
  pcbInfo: {
    type: Object,
    default: () => {},
  },
});
const emit = defineEmits(['closePcbWaitingMailingModel', 'goToMail']);
const router = useRouter();
const pcbVisible = ref(false);

const goToMail = () => {
  router.push({ query: { type: 1, tabs: 1, recordType: 2 } });
  emit('goToMail');
  emit('closePcbWaitingMailingModel');
};

let pcbData = ref({});
/**
 * 获取pcb邮寄列表详情
 */
const getQueryPcbaPcbOrderList = (page = 1, limit = 10, id = '') => {
  // mailingData.pcbData = [];
  const obj = {
    customerAccountId: 0,
    dataSource: 3,
    endTime: '',
    limit: limit,
    orderStatus: 0,
    page: page,
    pageType: 0,
    pcbLayer: '',
    pcbStatus: 0,
    pcbaOrderId: id,
    productId: 0,
    serial: '',
    startTime: '',
  };
  queryPcbaPcbOrderList(obj).then((res) => {
    if (res.code === 200) {
      pcbData.value = res.data.list[0];
      // mailingData.pcbData = res.data.list;
      // mailingData.pcbList = res.data;
      console.log(res, 'pcb');
    } else {
      ElMessage.error(res.msg);
    }
  });
};

defineExpose({
  getQueryPcbaPcbOrderList,
});
</script>

<style lang="scss" scoped>
.main {
  width: 100%;
  height: 100%;
  ul {
    width: 100%;
    height: 100%;
    li {
      width: 100%;
      height: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      span {
        font-size: 14px;
        color: #333333;
        &:nth-child(1) {
          width: 100px;
        }
        &:nth-child(2) {
          width: 200px;
        }
      }
    }
  }
}
</style>
